package net.kucoe.grin.sample.printing;

import net.kucoe.grin.Strategy;
import net.kucoe.grin.utils.ResultFuture;

/**
 * Prints string passed in console.
 * 
 * @author Vitaliy Basyuk
 */
public class Printer {
    
    /**
     * Prints string passed.
     * 
     * @param string
     * @return {@link PrintedString}
     */
    @Strategy
    public PrintedString print(final String string) {
        System.out.println(string);
        ResultFuture<PrintedString> resultFuture = new ResultFuture<PrintedString>(PrintedString.class, string, true);
        PrintedString printedString = resultFuture.getResult();
        return printedString;
    }
}
